<?php $imagesAttributes = Utils::getImageSize($obj['User']['sfAsset'][ 'Folder' ][ 'relative_path' ], $obj['User']['sfAsset'], 48, 42); ?>
<?php $hasAvatar = !is_null($obj['User']['sfAsset']['filename']) ? true : false; ?>

<div class="avatar-box">
    <div class="content-avatar-box">
        <?php if($hasAvatar && !$obj->is_delete): ?>
            <?php echo image_tag($imagesAttributes['small']['url'], array('title' => $obj['User']['sfAsset']['filename'], 'width' => $imagesAttributes['small']['width'], 'height' => $imagesAttributes['small']['height'], 'style' => 'margin-top: ' . $imagesAttributes['small']['marginTop'] . 'px; margin-left: ' . $imagesAttributes['small']['marginLeft'] . 'px')) ?>
        <?php else: ?>
            <?php echo image_tag('/images/noavatar.png', array('title' => 'aucun avatar', 'width' => '48', 'height' => '42')) ?>
        <?php endif ?>
    </div>
</div>

<div class="author">
    <a name="<?php echo $i ?>" class="ancre">#<?php echo $i ?></a> écrit par <?php echo $name ?>
    <span class="date">Le <?php echo format_date($date, "f") ?></span>
    <?php if($obj->getAuthorWebsite()){ ?>
        <span class="website">Site / Blog : <?php echo link_to(truncate_text($obj->getAuthorWebsite(), 40, '...'), $obj->getAuthorWebsite(), array('target' => '_blank')) ?></span>
    <?php } ?>
</div>